package com.baihui.taobao.transition;

import com.baihui.taobao.authorize.TaoBaoSessionInfo;
import com.taobao.api.ApiException;
import com.taobao.api.request.TraderatesGetRequest;
import com.taobao.api.response.TraderatesGetResponse;

/**
 * Created by Kevin.
 * User: HSZM1106-0312
 * Date: 12-1-12
 * Time: 下午10:49
 */
public class RateCases extends Cases{
    public RateCases(TaoBaoSessionInfo info) {
        super(info);
    }
    
    public String getRate() throws Exception {
        TraderatesGetRequest req=new TraderatesGetRequest();
        req.setFields("tid,oid,role,rated_nick,nick,result,created,item_title,item_price,content,reply");
        req.setRateType("give");
        req.setRole("buyer");
        try {
            TraderatesGetResponse response = getTaoBaoClient().execute(req, getSessionInfo().getTopSession());
            return response.getBody();
        } catch (ApiException e) {
            throw new Exception(e) ;
        }
    }
}
